<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>

<blockquote class="layui-elem-quote"><{$action}></blockquote>

<form class="layui-form layui-form-pane" method="post" action="/role/save" id="form_add_role">
	<input type="hidden" value="<{$role_info.id|default:"0"}>" name="id" />
	
	<div class="layui-form-item">
		<label class="layui-form-label">角色名称</label>
		<div class="layui-input-block">
            <input type="text" class="layui-input" name="role_name" lay-verify="required" value="<{$role_info.role_name|default:""}>" >
		</div>
	</div>

	
	      		<{foreach from=$privilege_list item=item key=key}>
	      		<fieldset class="layui-elem-field" style="padding-top:20px;">
  					<legend><{$item->menu_title}>权限</legend>
	        		<div class="layui-inline">
				  		<div style="width:100%; float:left; padding-bottom:18px;">
					  		<div class="layui-input-block">
						  	<input class="check_all" type="checkbox" title="全选">
						  	<{foreach from=$item->sub item=sub_item key=sub_key}>
							<input type="checkbox" id="inlineCheckboxSub<{$sub_key}>" title="<{$sub_item->menu_title}>" name="role_privilege[]" <{if isset($role_info.role_privilege) AND $sub_item->menu_url|in_array:$role_info.role_privilege}>checked=""<{/if}> value="<{$sub_item->menu_url}>"">
						  	<{/foreach}>
						  	</div>
					  	</div>
				  	</div>
				</fieldset>
			  	<{/foreach}>
	        
	

	<div class="layui-input-block">
  		<button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>

<{include file="public_html/footer.html"}>